package com.yuan.blog.service.impl;

import com.alibaba.fastjson.JSON;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @program: blog-core
 * @description:
 * @author: yuan_boss
 * @create: 2023-01-07 09:28
 **/
@Service
public class NormalUserService {

    public List<Map> clear(String json) {
        //去除密码
        List<Map> maps = JSON.parseArray(json, Map.class);
        Map map = maps.get(0);
        List<Map> records = (List<Map>)map.get("records");
        records.forEach(record->{
            record.remove("password");
            record.remove("firstPassword");
        });
        return maps;

    }
}
